//
//  EventStatisticsDisposalCell.m
//  ConvenientlyTake
//
//  Created by 张奇 on 2022/12/23.
//

#import "EventStatisticsDisposalCell.h"

@interface EventStatisticsDisposalCell ()
@property (weak, nonatomic) IBOutlet UIImageView *rankImgView;
@property (weak, nonatomic) IBOutlet UILabel *rankLabel;

@property (weak, nonatomic) IBOutlet UILabel *departmentLabel;
@property (weak, nonatomic) IBOutlet UILabel *percentLabel;


@end

@implementation EventStatisticsDisposalCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.rankLabel.layer.cornerRadius = 10;
    self.rankLabel.layer.masksToBounds = YES;
    self.rankLabel.backgroundColor = RGB(247, 248, 250);
}

- (void)setRateModel:(EventDisposalRateVo *)rateModel {
    _rateModel = rateModel;
    self.rankLabel.text = R(rateModel.rank);
    self.departmentLabel.text = R(rateModel.rankName);
    self.percentLabel.text = [NSString stringWithFormat:@"%.2f%%", rateModel.rankRate];
}

- (void)setDisposalModel:(EventDisposalRateVo *)disposalModel {
    _disposalModel = disposalModel;
    self.rankLabel.text = R(disposalModel.rank);
    self.departmentLabel.text = R(disposalModel.rankName);
    self.percentLabel.text = R(disposalModel.rankNum);
}

- (void)setRow:(NSInteger)row {
    _row = row;
    if (row == 0 || row == 1 || row == 2) {
        self.rankImgView.hidden = NO;
        self.rankImgView.image = [UIImage imageNamed:[NSString stringWithFormat:@"eventStatistics_rank%ld", row+1]];
        self.rankLabel.hidden = YES;
    } else {
        self.rankImgView.hidden = YES;
        self.rankLabel.hidden = NO;
//        self.rankLabel.text = String(row+1);
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
